import React from "react"

class Counter extends React.Component {
  state = {
    count: 0
  }
  changeCount = () => {
    this.setState({
      count: this.state.count + 1
    })
  }
  render () {
    return <button onClick={this.changeCount}>{this.state.count}</button>
  }
}
// 根组件
function App () {
  return (
    <div>
      <Counter></Counter>
    </div>
  )
}
export default App